package edu.ctbu.labtest.controller;

import edu.ctbu.labtest.domain.Teacher;
import edu.ctbu.labtest.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    @RequestMapping("/teacher/list")
    public String list(Model model){

        List<Teacher> teachers = teacherService.findAll();

        model.addAttribute("data",teachers);

        return "/student/teacher";
    }
}
